package org.rslai.autotest.core.page.impl;

import java.util.List;

import org.rslai.autotest.core.page.Compress;

/**
 * 压缩解压缩工具实现<br>
 * 提供zip 压缩、解压缩 等方法
 * @author rslai
 */
public class CompressImpl implements Compress {

	private String encoding; // 编码方案

	public void setEncoding(String encoding) {
		this.encoding = encoding;
	}

	public void zip(String sourcePathName, String zipFileName) {
		org.rslai.util.compress.Zip zip = new org.rslai.util.compress.Zip();
		zip.setEncoding(this.encoding);
		zip.zip(sourcePathName, zipFileName);
	}

	public void zip(String sourcePathName, String zipFileName, List<String> includes, List<String> excludes) {
		org.rslai.util.compress.Zip zip = new org.rslai.util.compress.Zip();
		zip.setEncoding(this.encoding);
		zip.zip(sourcePathName, zipFileName, includes, excludes);
	}

	public void unZip(String zipFileName, String destDir) {
		org.rslai.util.compress.Zip zip = new org.rslai.util.compress.Zip();
		zip.setEncoding(this.encoding);
		zip.unZip(zipFileName, destDir);
	}

} 